<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
		function bg3(){
             var r=Math.floor(Math.random()*256);
             var g=Math.floor(Math.random()*256);
             var b=Math.floor(Math.random()*256);
             return "rgb("+r+','+g+','+b+")";
         }
			window.onload=function(){
				var th=document.getElementsByTagName('th');//
				for(var i=0;i<th.length;i++){
					th[i].style.background='yellow';
				}
//				var td=document.getElementsByTagName('td');
//				for(var i=0;i<td.length;i++){
//					td[i].style.background=bg3();
//				}
				
				
				
				
				
				var table=document.getElementsByTagName('table')[0];
				
				for(var j=0;j<3;j++){
				var tr=document.createElement('tr');
				table.appendChild(tr);
				for(var i=0;i<5;i++){
					var td=document.createElement('td');
					td.style.background=bg3();
					tr.appendChild(td);
						var txt=document.createTextNode("1");
						td.appendChild(txt);
				}
				}
				
			}
		</script>
	</head>
	<body>
<table border="1">
				<tr>
					<th class="" >部门名称</th>
					<th class="">部门电话</th>
					<th class="">部门负责人</th>
					<th class="">所属单位</th>
					<th class="">操作</th>
				</tr>
<!--				<tr id="xy">
					<td>1</td>
					<td>1</td>
					<td>1</td>
					<td>1</td>
					<td>1</td>
				</tr>
				<tr class="tt">
					<td>1</td>
					<td>1</td>
					<td>1</td>
					<td>1</td>
					<td>1</td>
				</tr>
				<tr>
					<td>1</td>
					<td>1</td>
					<td>1</td>
					<td>1</td>
					<td>1</td>
				</tr>-->
		</table>
	</body>
</html>
